﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Administrator/Views/Shared/admin.master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<CollegeWebsite.Areas.Administrator.Models.Student>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Index</h2>

    <table>
        <tr>
           
            <th>
                StudentName
            </th>
            <th>
                Identity No.</th>
            <th>
                FatherName
            </th>
            <th>
                MotherName
            </th>
            <th>
                DateOfBirth
            </th>
            <th>
                Gender
            </th>
           <%-- <th>
                AdmissionID
            </th>--%>
            <th>
                SupportDetails
            </th>
            <th>
                Status
            </th>
             <th></th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr <%= item.Status?"" : "style=\"background: mistyrose\"" %>>
            
            <td>
                <%= Html.Encode(item.StudentName) %>
            </td>
            <td>
                <%= Html.Encode(item.PIN) %>
            <td>
                <%= Html.Encode(item.FatherName) %>
            </td>
            <td>
                <%= Html.Encode(item.MotherName) %>
            </td>
            <td>
               <%= Html.Encode(item.DateOfBirth.ToString("dd/MM/yyyy")) %>
               </td>
            <td>
                <%= item.Gender ? "Male" : "Female"%>

            </td>
           <%-- <td>
                 <%= (item.Admission != null)?item.Admission.Course.CourseName : ""  %>
            </td>--%>
            <td>
                <%= Html.Encode(item.SupportDetails) %>
            </td>
            <td>
                <%= item.Status ? "Student" : "<span style=\"color: crimson\">Drropped</span>" %>
                
            </td>
            <td>
                <%= Html.ActionLink("Edit", "Edit", new { id=item.StudentID }) %> |
                <%= Html.ActionLink("Details", "Details", new { id=item.StudentID })%> |
                <%= Html.ActionLink("Delete", "Delete", new { id=item.StudentID })%>
            </td>
        </tr>
    
    <% } %>

    </table>

    <p>
        <%= Html.ActionLink("Create New", "Create") %>
    </p>

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="TitleContentPlaceHolder" runat="server">
</asp:Content>

